package util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.sql.SQLException;

public class StringUtils {

	public static void clobToString(java.sql.Clob data, StringBuilder sb) {
		try {
			final Reader reader = data.getCharacterStream();
			final BufferedReader br = new BufferedReader(reader);
			int b;
			while (-1 != (b = br.read())) {
				sb.append((char) b);
			}
			br.close();
		} catch (SQLException e) {
			sb.append(e.toString());
		} catch (IOException e) {
			sb.append(e.toString());
		}
	}
}
